<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
    <title>抢红包-首页</title>

    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="yes" name="apple-mobile-web-app-capable">

    <link rel="stylesheet" href="/red/h5/base.css">

    <style>
      html{
        height: 100%;
        overflow:hidden;
      }
      body{
        height: 100%;
        background: #fff;
      }
      .redPacket_container{
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
      }
      .redPacket_content{
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        position: relative;
        width: 6rem;
        height: 9.95rem;
        margin: 0 auto;
      }
      .redPacket_content img{
        width: 6rem;
        height: auto;
      }
      .redPacket_absolutely_container{
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        padding-top: 2.19rem;
      }
      .redPacket_absolutelyHeader_container{
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .redPacket_absolutelyHeader_container img{
        width: .5rem;
        border-radius: 4px;
      }
      .redPacket_absolutelyHeader_container p{
        font-size: .32rem;
        color: #fedbab;
        letter-spacing: 2px;
        padding-left: 7px;
        font-weight: bold;
      }
      .redPacket_absolutely_container h3{
        font-size: .40rem;
        color: #fedbab;
        text-align: center;
        margin-top: .3rem;
        letter-spacing: 2px;
      }
      .redPacket_absolutelyFooter_container{
        position: absolute;
        left: 0;
        bottom: 0;
        right: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        margin-bottom: 0.3rem;
      }
      .redPacket_absolutelyFooter_container img{
        width: 1.89rem;
        height: 1.89rem;
        margin-bottom: 0.47rem;
        border-radius: 50%;
        background: #ebcd9a;
      }
      .redPacket_absolutelyFooter_container a{
        font-size: 0.26rem;
        color: #fedbab;
      }
      /*版权信息*/
      .public_copyright_container{
        width: 100%;
      }
      .public_copyright_content{
        position: relative;
        margin: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: url(http://weidogstest.oss-cn-beijing.aliyuncs.com/0d118b616ad13e1f874e458c8310be76.png)no-repeat center center;
      }
      .public_copyright_content p{
        background: #fff;
        font-size: 13px;
        color: #999;
        line-height: 17px;
        text-align: center;
        padding: 0 5px;
      }
    </style>

  </head>
  <body>
    <div class="redPacket_container"> 
      <div class="redPacket_content">
        <img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/a40147081263ae5e878e0204c21ef024.png">
        <div class="redPacket_absolutely_container">
          <div class="redPacket_absolutelyHeader_container">
               {if $cover->red_image}
               <img src="{$cover->red_image}">
               {else}
                 <img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/b8cd37c1cf5169df7e4a18d18e47b31d.png">
               {/if}
            <p>{if $cover->red_title}{$cover->red_title}{else}系统红包{/if}</p>
          </div>
          {if $list->status == 1}
          <h3>{if $cover->red_content}{$cover->red_content}{else}恭喜发财，大吉大利{/if}</h3>
          {/if}
          <!-- 红包抢完的情况 显示下方h3标签 -->
          {if $list->status == 0}
          <h3>手慢了，红包派完了</h3>
          {/if}
        </div>
        <div class="redPacket_absolutelyFooter_container">
          <!-- 红包抢完的情况 下方img隐藏 -->
          {if $list->status == 1}
          <img id="openRedPacket" src="http://weidogstest.oss-cn-beijing.aliyuncs.com/ef726af0f869523af9e615d06c58a3dc.png" onclick="check('{$list->id}')">
          {/if}
          <a href="check.html?list_id={$list->id}">查看领取详情 &gt;</a>
        </div>
      </div>
      <!-- 版权 -->
      <div class="public_copyright_container">
        <div class="public_copyright_content">
          <p>{$copyright}</p>
        </div>
      </div>
    </div>
    

  </body>
</html>
<script src="/red/lib/layui.js"></script>
<script src="/js/ajax.js"></script>
<script type="text/javascript">
	function check(id){
		var user_id = '{$user_id}';
		var OpenId = '{$OpenId}';
		myAjaxPost(false, true, "subhb.html", { list_id:id,user_id:user_id,OpenId:OpenId}, function (resp) {
      if (resp.status == 'success') {
        window.location.href = 'check.html?list_id='+id;
			}else{
        if(!resp.data){
          alert(resp.msg);
        }else{
          alert(resp.msg+":"+resp.data);
        }
      }
	 	});
	}

</script>